Getting link target object

Hi.

I'm running into a problem when accessing an object that is the target of a link from my current object. The code I am running is using the current module, cycles through an object for out-links and whenever it finds an out-link, it sets objLink as the object, or well it is supposed to. As of right now, it recogizes the link, lnk, and when it get to:

code
objLink = target(lnk)
code

objlink get sets to null, although it sees the link. Is there something needed in order to get a handle on this object? Read the module, open the module etc?

Thanks
Eric
Eric_Hillen - Wed Apr 13 15:00:26 EDT 2011

Re: Getting link target object
Eric_Hillen - Wed Apr 13 15:01:36 EDT 2011

P.S. I failed at using the code thing.

Re: Getting link target object
Eric_Hillen - Wed Apr 13 15:58:08 EDT 2011

Eric_Hillen - Wed Apr 13 15:01:36 EDT 2011
P.S. I failed at using the code thing.

I answered my own question. Need to read the module.

Re: Getting link target object
llandale - Wed Apr 13 15:59:05 EDT 2011

Link lnk
Object objLink
for lnk in (current Object) ->"*" do
{  objLink = target(lnk)
   break
}
if (null objLink) //
then infoBox("No out links")
else infoBox("One target of current object is " identifier(objLink))


That doesn't display a target of a link from the current object?

Do perhaps you have AutoDeclare off and forget to declare "oTarget" as an "Object"?

 

 

  • Louie

 

 

Re: Getting link target object
Eric_Hillen - Thu Apr 14 09:05:37 EDT 2011

llandale - Wed Apr 13 15:59:05 EDT 2011

Link lnk
Object objLink
for lnk in (current Object) ->"*" do
{  objLink = target(lnk)
   break
}
if (null objLink) //
then infoBox("No out links")
else infoBox("One target of current object is " identifier(objLink))


That doesn't display a target of a link from the current object?

Do perhaps you have AutoDeclare off and forget to declare "oTarget" as an "Object"?

 

 

  • Louie

 

 

It was declared at the beginning of the code, but the object I was trying to get a handle on, wasn't in the same module. So this is what fixed it.
 

string tmn = fullName target(lnk)
if(!open module tmn){
    read(tmn, false)
}

 


That was inserted in the for loop, but before I set objLink equal to the object.